Skip to content

NTNU-IE-IIR/BlueJ-Checkstyle-Plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BlueJ-Checkstyle-Plugin

release license

checkstyle4bluej is a BlueJ plugin that allows you to use the Checkstyle source code analysis tool. The user is provided the ability to choose what Checkstyle configuration file to use.

Note: It is important that the configuration file is compatible with Checkstyle version 9.2.

overview-example

Installing the extension

  1. Download the latest version of the extension found here
  2. Move the downloaded JAR to a BlueJ extensions2 directory
  3. Start BlueJ

BlueJ Extensions can be installed in three different directories:

  • User directory installs for this user
  • System directory installs for all users of this system
  • Project directory installs for this project only

To install for a project, make a directory called extensions2 in the projects root directory and move the JAR to that directory.

In order to install for a user/system place the JAR in one of these directories:

Operating System Install-type Directories
Mac User $HOME/Library/Preferences/org.bluej/extensions2
System <BLUEJ_HOME>/BlueJ.app/Contents/Resources/Java/extensions2
Unix User $HOME/.bluej/extensions2
System <BLUEJ_HOME>/lib/extensions2
Windows User %USERNAME%\bluej\extensions2
System %PROGRAMFILES%\BlueJ\lib\extensions2

Tip: For Mac users, Control-click BlueJ.app and choose Show Package Contents to find the system directory.

For further information about Extensions in BlueJ see: BlueJ Extensions

Usage

The Checkstyle Plugin runs checks in BlueJ when a Project/Package is opened and when a class file's state changes. The plugin ignores files that have not been compiled.

You can view the violations discovered by choosing Show Checkstyle overview from the Tools menu.

show-example

From the overview window you can double-click a violation to highlight the text in the BlueJ editor.

Which configuration file to use can be defined in the BlueJ preferences.

You can find the preferences by choosing Preferences... from the Tools menu and navigating to the Extensions tab.

preferences-example

The selected default config will be loaded by default, but can be changed from the dropdown menu in the overview window.

current-config-example

Issues

Are you experiencing bugs/problems using this plugin?

Submit a bug report with detailed reproduction steps.

We also appreciate ideas of enhancements and new features, feel free to suggest new features here.

Contributing

Contributions are welcome. Feel free to discuss the changes with us in a feature request before submitting a Pull Request.

Dependencies

This plugin relies on the usage of the BlueJ Extensions2 API. The latest version is added to this repository in the lib directory. The bluejext2 jar is bundled with the BlueJ installation, it can be retrieved from there. Detailed instructions can be found in the BlueJ documentation.

A toolscript is available for Windows users to update the API, it can also be used as a reference as on how to install new versions of the API to the lib directory.

The current version of the API is version 3.2, from version 5.0.2 of BlueJ.

Note: the script assumes BlueJ is installed for all users.

A lot of core functionality for this plugin is provided by BlueJ-Linting-Core, feel free to take a look at it as well.